#include <iostream>
#include <algorithm>

using namespace std;

const int N = 2e5 + 10;

struct node
{
    int num, cost;
    bool operator< (const node& x)
    {
        return cost < x.cost;
    }
}a[N];

int main()
{
    int n; cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i].cost;
        a[i].num = i;
    }
    sort(a + 1, a + 1 + n);
    int ans = 0, curc = 0, maxnum = 0;
    for(int i = 1; i <= n; i++)
    {
        int tmp = maxnum;
        maxnum = max(a[i].num, maxnum);
        if(maxnum != a[i].num) continue;
        curc += maxnum - tmp;
        ans += curc / a[i].cost;
        curc %= a[i].cost;
    }
    cout << ans << endl;
    return 0;
}